import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 87111
 * Date: 2025-11-12
 * Time: 14:08
 */
public class Demo5 {
    public static void main(String[] args) {
        try(Writer writer = new FileWriter("./test.txt",true)) {
            //输入数字，写入的是对应的unicode值
            writer.write(65);

            writer.write("世界");

            char[] c1 = {'你','好'};
            writer.write(c1);

            writer.write("abcdefg",2,3);

            char[] c2 = {'a','b','c','d'};
            writer.write(c2,1,2);

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
